Hooks:PostHook(CopBase, "post_init", "copbase_post_init", function(self)
	self:init_gear_pick()
end)

function CopBase:init_gear_pick()
	
	-- local mp38 = weapon_unit == Idstring("units/vanilla/weapons/wpn_npc_ger_mp38/wpn_npc_ger_mp38")
	-- local stg = weapon_unit == Idstring("units/vanilla/weapons/wpn_npc_ger_stg44/wpn_npc_ger_stg44")
	-- local comm = self._unit:base()._tweak_table == "german_commander" 
	-- local ar_comm = unit_name == Idstring("units/vanilla/characters/enemies/models/german_commander/german_commander") 
	-- local weapon_unit = self._unit:inventory():equipped_unit()
	
	local ger_officer = self._unit:base()._tweak_table == "german_officer" 
		
	local ss_ar = self._unit:base()._tweak_table == "german_heavy" or self._unit:base()._tweak_table == "german_heavy_commander_backup" 
	
	local pistoleer_generic = self._unit:base()._tweak_table == "german_fallschirmjager_light" or self._unit:base()._tweak_table == "german_gebirgsjager_light" 
	
	local is_dnau = BLT.Mods:GetModByName("RAID WW2: Old Age of Heisters") or BLT.Mods:GetModByName("raid ww2 old age of heisters") 
	
	local isnt_dnau = not BLT.Mods:GetModByName("RAID WW2: Old Age of Heisters") and not BLT.Mods:GetModByName("raid ww2 old age of heisters")
	
	local smg_generic = {
	  "german_light",
	  "german_fallschirmjager_heavy_mp38",
	  "german_light_commander_backup",
	  "german_grunt_light_mp38",
	  "german_waffen_ss_mp38",
	  "german_grunt_mid_mp38",
	  "german_grunt_heavy_mp38",
	  "german_gebirgsjager_light_mp38",
	  "german_gebirgsjager_heavy_mp38",
	  "german_fallschirmjager_light_mp38"
	}		
	
	local rifleman_generic = {
	  "german_light_kar98",
	  "german_fallschirmjager_heavy_kar98",
	  "german_grunt_light_kar98",
	  "german_grunt_mid_kar98",
	  "german_gasmask_shotgun",
	  "german_gasmask_commander_backup_shotgun",
	  "german_waffen_ss_kar98",
	  "german_grunt_heavy_kar98",
	  "german_heavy_kar98",
	  "german_gebirgsjager_light_kar98",
	  "german_gebirgsjager_heavy_kar98",
	  "german_fallschirmjager_light_kar98"
	}		
	
	local ar_generic = {
	  "german_gebirgsjager_heavy",
	  "german_grunt_heavy",
	  "german_gasmask",
	  "german_gasmask_commander_backup",
	  "german_waffen_ss",
	  "german_fallschirmjager_heavy"
	}		
	
	local shotgunner_generic = {
	  "german_heavy_shotgun",
	  "german_light_shotgun",
	  "german_grunt_light_shotgun",
	  "german_fallschirmjager_heavy_shotgun",
	  "german_fallschirmjager_light_shotgun",
	  "german_waffen_ss_shotgun",
	  "german_gebirgsjager_light_shotgun",
	  "german_gebirgsjager_heavy_shotgun",
	  "german_grunt_heavy_shotgun",
	  "german_grunt_mid_shotgun"
	}

	--also kinda nervous about this mod in general cause using parentheses is apparently bad for performance or whatever.
	
	--[[if self._unit:damage() and self._unit:damage():has_sequence("smg") and comm and weapon_unit == "ger_mp38_npc" then
		self._unit:damage():run_sequence_simple("smg")
		log("hubart")
	end--]]
	
	if table.contains(shotgunner_generic, self._unit:base()._tweak_table) then
		if self._unit:damage() and self._unit:damage():has_sequence("shotgunner") then
			self._unit:damage():run_sequence_simple("shotgunner")
		end
	end
	if table.contains(rifleman_generic, self._unit:base()._tweak_table) then
		if self._unit:damage() and self._unit:damage():has_sequence("rifleman") then
			self._unit:damage():run_sequence_simple("rifleman")
		end
	end
	if table.contains(smg_generic, self._unit:base()._tweak_table) then
		if self._unit:damage() and self._unit:damage():has_sequence("smg") then
			self._unit:damage():run_sequence_simple("smg")
		end
	end
	if table.contains(ar_generic, self._unit:base()._tweak_table) then
		if self._unit:damage() and self._unit:damage():has_sequence("ar") then
			self._unit:damage():run_sequence_simple("ar")
		end
	end
	
	if self._unit:damage() and self._unit:damage():has_sequence("officer") and ger_officer then
		self._unit:damage():run_sequence_simple("officer")	
	elseif self._unit:damage() and self._unit:damage():has_sequence("pistoleer") and pistoleer_generic then
		self._unit:damage():run_sequence_simple("pistoleer")	
	elseif self._unit:damage() and self._unit:damage():has_sequence("ar") and ss_ar and isnt_dnau then
		self._unit:damage():run_sequence_simple("ar")
	elseif self._unit:damage() and self._unit:damage():has_sequence("ar") and ss_ar and is_dnau then
		self._unit:damage():run_sequence_simple("ar_dnau")
	end	
end